import { Component, EventEmitter, Output } from '@angular/core';
import { RgvConfig } from 'src/components/scenarios/models';

@Component({
  selector: 'app-rgv-setting',
  templateUrl: './rgv-setting.component.html',
  styleUrl: './rgv-setting.component.scss'
})
export class RgvSettingComponent {
  sidebarVisible: boolean = false;

  cfg?: RgvConfig;
  @Output()
  onHide: EventEmitter<RgvConfig> = new EventEmitter();

  onEdit(cfg: RgvConfig) {
    this.cfg = { ...cfg };
    this.sidebarVisible = true;
  }

  onSidebarHide() {
    this.onHide.emit(this.cfg!);
    this.cfg = undefined;
  }
}
